#!/bin/bash
# 检查是否至少有两个个参数（jar文件路径，port）
if [ "$#" -lt 2 ]; then
    echo "Usage: $0 <path_to_jar> [server_port] "
    exit 1
fi
java -jar -XX:+UseG1GC -Xms1024m -Xmx1024m -Xss256k -XX:MetaspaceSize=128m ${1:-'platform-admin.jar'} \
        --server.port=${2:-19000} \
        --spring.datasource.druid.master.url='jdbc:mysql://127.0.0.1:3306/platform?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8&autoReconnectForPools=true&failOverReadOnly=false' \
        --spring.datasource.druid.master.username=root \
        --spring.datasource.druid.master.password=exceeddata  \
        --spring.data.redis.password=exceeddata